<template>
  <router-view />
</template>
<script>
export default {
  created() {
    const store = this.$store.state;
    window.onbeforeunload = function () {
      const { addusermodules, tagmodules } = store;
      sessionStorage.setItem("taglist", JSON.stringify(tagmodules.taglist)); //获取标签页信息
      sessionStorage.setItem("user", JSON.stringify(addusermodules)); //用户信息
    };
  },
  mounted() {
    const store = this.$store.state;
    let taglist = sessionStorage.getItem("taglist");
    let addusermodules = sessionStorage.getItem("user");
    if (taglist) {
      store.tagmodules.taglist = JSON.parse(taglist);
    }
    if (addusermodules) {
      Object.assign(store.addusermodules, JSON.parse(addusermodules));
    }
    sessionStorage.removeItem("taglist");
    sessionStorage.removeItem("addusermodules");
  },
};
</script>
<style lang="less">
html,
body,
#app {
  padding: 0px;
  margin: 0px;
  height: 100%;
}
</style>
